app.service('specificationService', function ($http) {
    this.findAll = function () {
        return $http.get('/specification/list');
    }
    this.findByPage = function (pageNum, pageSize) {
        return $http.get('/specification/list/' + pageNum + '/' + pageSize);
    }
    this.search = function (pageNum, pageSize, searchEntity) {
        return $http.put('/specification/search/' + pageNum + '/' + pageSize, searchEntity);
    }
    this.findById = function (id) {
        return $http.get('/specification/' + id);
    }
    this.update = function (entity) {
        return $http.put('/specification', entity);
    }
    this.save = function (entity) {
        return $http.post('/specification', entity);
    }
    this.delete = function (ids) {
        ids+='&_method=delete';
        //以表单编码方式提交
        return $http.post('/specification/delete', ids,{
            headers:{
                "Content-Type":"application/x-www-form-urlencoded"
            }
        });
    }
    this.findOptions=function(){
        return $http.get("/specification/list/options");
    }
});